﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MattDotson.GlobalToolkit
{
    /// <summary>
    /// Helper class for sanitizing user input
    /// </summary>
    internal static class Guard
    {
        public static void NotNull(string paramName, object value)
        {
            if (null == value)
            {
                throw new ArgumentNullException(paramName);
            }
        }

        public static void NotNullOrEmpty(string paramName, string value)
        {
            Guard.NotNull(paramName, value);

            if (0 == value.Length)
            {
                throw new ArgumentException("", paramName);
            }
        }
    }
}
